home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 43 / Mac Magazin and MacEasy Magazine CD - Issue 43.iso / Software / Mobiles Büro / Newton / Newton Entwickler / DIL 2.0 Sample Code ƒ / Mini-MetaData-1 / README.Changes < prev   
Text File  |  1996-05-20  |  2KB  |  43 lines

  1. /*
  2. **      Newton Developer Technical Support Sample Code
  3. **
  4. **      Mini-MetaData, changes from the Mini-MetaData NTJ article.
  5. **
  6. **      by Ryan Robertson, Newton Developer Technical Support
  7. **
  8. **      Copyright © 1996 by Apple Computer, Inc.  All rights reserved.
  9. **
  10. **      You may incorporate this sample code into your applications without
  11. **      restriction.  This sample code has been provided "AS IS" and the
  12. **      responsibility for its operation is 100% yours.  You are not
  13. **      permitted to modify and redistribute the source as "DTS Sample Code."
  14. **      If you are going to re-distribute the source, we require that you
  15. **      make it clear in the source that the code was descended from
  16. **      Apple-provided sample code, but that you've made changes.
  17. */
  18.  
  19. Since the publication of the Mini-MetaData NTJ article, the correct way to register a format has been changed.
  20.  
  21. Here is the correct way to register a format:
  22.  
  23. local registry;
  24. if GlobalVarExists( '|MiniMetaDataRegistry:DTS| ) then
  25.     registry = GetGlobalVar( '|MiniMetaDataRegistry:DTS| );
  26. else
  27.     registry := DefGlobalVar( EnsureInternal('|MiniMetaDatRegistry:DTS|), 
  28.                                EnsureInternal('{}) );
  29.  
  30. registry.( EnsureInternal( myFormatSymbol ) ) := myFormat;
  31.  
  32.  
  33. Here is how you would remove your format from the registry:
  34.  
  35. if GlobalVarExists( '|MiniMetaDataRegistry:DTS| ) then begin
  36.     local registry = GetGlobalVar( '|MiniMetaDataRegistry:DTS| );
  37.     if HasSlot( registry, myFormatSymbol ) then
  38.         RemoveSlot( registry, myFormatSymbol );
  39. end;
  40.  
  41.  
  42. The symbol myFormatSymbol is the same symbol found in the symbol slot of your format frame.
  43.